package com.atguigu.test07;


import com.atguigu.test06.bean.Employee;
import org.junit.jupiter.api.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @author haoranlu
 * @project IntelliJ IDEA
 */
public class TestEmployeeDAOImp1 {
    private EmployeeDAO ed = new EmployeeDAOImp1();
    @Test
    public void test01() throws ParseException {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
        String birthday = "1999-12-29";
        Employee emp = new Employee(0,"钱七","男","架构师",sf.parse(birthday));

        ed.addEmployee(emp);
    }
    @Test
    public void test02(){
        Employee d = ed.getById(1001);
        System.out.println(d);
    }
    @Test
    public void test03(){
        List<Employee> list = ed.getAll();
        list.forEach(System.out::println);
    }
    @Test
    public void test04(){
        long count = ed.getEmployeeCount();
        System.out.println(count);
    }
}
